package com.Jhu1.client;

import com.Jhu1.entity.Store;
import com.Jhu1.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "order", fallback = OrderClientHandler.class)
public interface OrderClient {
    @GetMapping("/merchant/all")
    Result<List<Store>> getMerchantAll();
    
    @PostMapping("/merchant/add")
    Result<?> addMerchant(@RequestBody Store merchant);
    
    @GetMapping("/merchant/myStore")
    Result<Store> myStore();
    
    @PatchMapping("/merchant/update")
    Result<?> update(@RequestBody Store store);
    
    @DeleteMapping("/merchant/delete")
    Result<?> deleteMerchant(@RequestParam("id") Integer id);
    
    Store getMerchantByName(String storeName);
    
    void register(Integer storeId, Integer userId);
}
